package com.baitengsoft.patentservicemonitor.job.controller;

import com.baitengsoft.patentservicemonitor.common.utils.PageUtils;
import com.baitengsoft.patentservicemonitor.common.utils.Query;
import com.baitengsoft.patentservicemonitor.common.utils.Res;
import com.baitengsoft.patentservicemonitor.job.cloud.AliyunCloudStorageService;
import com.baitengsoft.patentservicemonitor.job.cloud.CloudStorageConfig;
import com.baitengsoft.patentservicemonitor.job.entity.PacPatentinfoEntity;
import com.baitengsoft.patentservicemonitor.job.service.PacPatentinfoOutService;
import com.baitengsoft.patentservicemonitor.job.service.PacPatentinfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Author: KennyGu
 * @Date: 2018/1/10
 * @Description:
 */

@RestController
@RequestMapping("/job/patent")
@Api(value = "数据服务",description = "获取专利信息")
public class PacPatentinfoController {
    @Autowired
    private PacPatentinfoService pacPatentinfoService;

    /**
     * 列表
     */
    @ResponseBody
    @RequestMapping(value="/list", method= RequestMethod.GET)
    @ApiOperation(value = "获取列表")
    public Res list(@RequestParam Map<String, Object> params){
        //查询列表数据
        Query query = new Query(params);
        List<PacPatentinfoEntity> sysLogList = pacPatentinfoService.queryList(query);
        int total = pacPatentinfoService.queryTotal(query);

        PageUtils pageUtil = new PageUtils(sysLogList, total, query.getLimit(), query.getPage());
        return Res.ok().put("page", pageUtil);
    }
}
